package com.robusta.cityuate.activities;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.robusta.cityuate.GCMIntentService;
import com.robusta.cityuate.R;
import com.robusta.cityuate.activities.QRActivity.ScanMode;
import com.robusta.cityuate.base.CityuateFragmentMenuActivity;
import com.robusta.cityuate.infoActivities.CityuateAboutUs;
import com.robusta.cityuate.utils.Token;

public class LandingActivity extends CityuateFragmentMenuActivity {

	private Context mContext = this;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.landing_view);
	}

	public void startFindSpotsActivity(View v) {
		mContext.startActivity(new Intent(mContext, FindSpotsMapActivity.class));
	}

	public void startManageSpotsActivity(View v) {
		mContext.startActivity(new Intent(mContext, ManageMyspotsActivity.class));
	}

	public void startUserProfileActivity(View v) {
		mContext.startActivity(new Intent(mContext, UserProfileActivity.class));
	}

	public void startRemindersListActivity(View v) {
		mContext.startActivity(new Intent(mContext, RemindersListActivity.class));
	}

	public void startCityuateAboutUsActivity(View v) {
		mContext.startActivity(new Intent(mContext, CityuateAboutUs.class));
	}

	public void startMyReservationsActivity(View v) {
		mContext.startActivity(new Intent(mContext,
				MyReservationsActivity.class));
	}

	public void startParkingActivity(View v) {
		mContext.startActivity(new Intent(mContext, ParkingStatusActivity.class));
	}

	public void QRReader(View v) {
		Intent i = new Intent(mContext, QRActivity.class);
		i.putExtra(QRActivity.SCAN_MODE, ScanMode.SPOT_DETAILS);
		mContext.startActivity(i);

	}

	public void logout(View v) {
		Token.removeToken(this);
		Intent act = new Intent(mContext, LoginActivity.class);
		act.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		mContext.startActivity(act);

		GCMIntentService.unregister(this);

		finish();
	}

}
